package com.galen.manual.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("settlements")
public class Settlement {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("settlement_number")
    private String settlementNumber; // 结算单号

    @TableField("user_id")
    private Long userId;

    @TableField("settlement_period_start")
    private LocalDateTime settlementPeriodStart; // 结算周期开始

    @TableField("settlement_period_end")
    private LocalDateTime settlementPeriodEnd; // 结算周期结束

    @TableField("task_count")
    private Integer taskCount; // 任务数量

    @TableField("total_quantity")
    private Integer totalQuantity; // 总数量

    @TableField("total_amount")
    private BigDecimal totalAmount; // 总金额

    @TableField("bonus_amount")
    private BigDecimal bonusAmount; // 奖励金额

    @TableField("penalty_amount")
    private BigDecimal penaltyAmount; // 扣款金额

    @TableField("final_amount")
    private BigDecimal finalAmount; // 实际结算金额

    @TableField("status")
    private Integer status; // 1:待确认 2:已确认 3:已支付

    @TableField("confirmed_time")
    private LocalDateTime confirmedTime; // 确认时间

    @TableField("paid_time")
    private LocalDateTime paidTime; // 支付时间

    @TableField("payment_method")
    private String paymentMethod; // 支付方式

    @TableField("remark")
    private String remark; // 备注

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    @TableField("deleted")
    private Integer deleted;

}